Skip to content

fix: 描画まわりのレビュー指摘(#7・#10・#11・#12)を修正 - #62

Merged
Yuru-Yurufu merged 6 commits into
mainfrom
fix/render-review
Oct 24, 2026
Merged

Yuru-Yurufu merged 6 commits into
mainfrom
fix/render-review

Conversation

@Yuru-Yurufu

Copy link
Copy Markdown
Owner

概要

Astra(Codex)のコードレビューの描画まわりの指摘 #7・#10・#11・#12 を直しました。PR #61 の上に積んでいます。

変更

  • オークの板材のハーフブロックから元のブロックに戻すレシピが無い #7 内側の面の消えすぎ:ダブルハーフの上下が接する面を描くかどうかを、ハーフの分類(DoubleSlabVariant)の一致で決めていた。NON_OPAQUE には葉・グロウストーンなど別の素材が混ざるため、葉の下のグロウストーンの上面が消え、葉の隙間から地面が見えていた。
    → 「同じ並びを通常ブロックで作ったら、その面は見えるか」をそのまま使う判定に変更(DoubleSlabUtils#shouldDrawInnerFace)。上が不透明なら見えない、同じガラスどうしなら見えない、それ以外は見える。
  • あと何個かハーフブロックを実装したい #10:両側とも普通のハーフ(ガラスなし)のときは、ガラスをつなぐための周囲の検索をしない。
  • アイコンを作る #11:ガラスのメッシュを作ったかどうかの判定に、作らない面を使っていたため、毎回作り直していた。明示的なフラグで管理。
  • 最新バージョンのfabric、neoforgeなどに対応させる #12:リソースの再読み込み(リソースパックの変更など)のたびに、古いテクスチャ配置のメッシュを捨てて作り直す。
  • 撮影の仕組み:描画範囲のチャンクの完成数が増えなくなるまで待ってから撮影・測定する(実機で遠くの地形が読み込み途中のまま測ってしまう問題への対策)。葉・光るブロック・ガラスの組み合わせを通常ブロックと並べて撮る比較(pair_XX)を追加。

テスト

  • GameTest 16件すべて成功。
  • 新しいテスト InnerFaceGameTests:素材10種類の総当たり(100通り)で、通常ブロックを実際に上下に置いたときの面の見え方と、ダブルハーフの内側の面の見え方が一致することを確かめる。

見た目(runScene で前のコミットと比較)

128枚中、違いは pair_00(上=葉・下=グロウストーン)と pair_01(上=グロウストーン・下=葉)の2枚だけ。どちらも、通常ブロックで組んだ隣の比較対象と同じ見た目になった。


Generated by Claude Code

…mal halves

- Track built state of the connected-glass mesh caches with explicit flags.
  The old check looked at a face that is never generated for some axes, so
  the meshes were rebuilt on every bake (review #11).
- Clear the static mesh caches whenever models are (re)loaded, so meshes
  with baked UVs are not reused after the texture atlas changes (review #12).
- Return early from the connected-glass model when neither half is glass,
  skipping the neighbour scan and allocations (review #10).
- Scene capture: wait until the number of built chunks stops changing
  before shooting or measuring, and add material-pair reference shots.
The face where the two halves touch was hidden whenever both halves had
the same DoubleSlabVariant, but NON_OPAQUE groups different materials
(leaves, glowstone, ...). A glowstone half under a leaf half lost its top
face, so the ground showed through the leaves (review #7).

Now the face is drawn exactly when the same two blocks stacked as full
blocks would draw it: hidden under an opaque block or between matching
glass, visible otherwise. A GameTest compares 100 material pairs against
full blocks placed in the world.
shouldDrawSide runs for every face of every block while building chunk
meshes. Check the block type before touching the world or block entities.

Scene capture: allow fixing the FPS cap with -Dslabee.scene.maxFps and
disable autosave while capturing.
Light propagation runs after blocks are placed. Shooting before it ends
made the ground shading around double slabs differ from run to run.
Disabling saving appears to make chunks that are unloaded while the camera
moves come back with recomputed light, so the ground shading differed
between runs. Under investigation; determinism check in progress.
@Yuru-Yurufu
Yuru-Yurufu changed the base branch from feature/double-slab-lighting to main October 24, 2026 16:57
@Yuru-Yurufu
Yuru-Yurufu merged commit 8ae0351 into main Oct 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant